package cm.tl.pms.common.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 公共字段信息
 *
 * @author w7h1te_ywq
 * @version 1.0.0
 * @date 2024-01-08 17:40
 */
@Component
public class ConstantConfig {

    /**
     * 服务器文件路径
     */
    private static String upload_file_prefix;

    /**
     * 项目文件夹
     */
    private static String upload_file_path;

    /**
     * 项目文件夹
     */
    private static String default_avatar_path;


    private static String upload_file_preUrl;


    @Value("${upload-file.prefix}")
    private void setUploadFilePrefix(String prefix) {
        upload_file_prefix = prefix;
    }

    @Value("${upload-file.path}")
    private void setUploadFilePath(String path) {
        upload_file_path = path;
    }

    @Value("${upload-file.default-avatar-path}")
    private void setDefaultAvatarPath(String defaultAvatarPath) {
        default_avatar_path = defaultAvatarPath;
    }

    @Value("${upload-file.preUrl}")
    private void setUpLoadFilePreUrl(String preUrl) {
        upload_file_preUrl = preUrl;
    }


    public static String getUploadFilePrefix() {
        return upload_file_prefix;
    }

    public static String getUploadFilePath() {
        return upload_file_path;
    }

    public static String getDefaultAvatarPath() {
        return default_avatar_path;
    }


    public static String getUploadFilePreUrl() {
        return upload_file_preUrl;
    }
}
